# redis 锁
import time
from redis import StrictRedis

redis_client = StrictRedis()


#                      set(name, value, ex=None, px=None, nx=False, xx=False, keepttl=False)
for i in range(10):
    print(redis_client.set('age', '18', ex=3, nx=True))
    time.sleep(1)
